
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                template="/mobile/templates/blankPageTemp.xhtml"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pm="http://primefaces.org/mobile" 
                xmlns:rich="http://richfaces.org/rich"
                xmlns:a4j="http://richfaces.org/a4j">

    <ui:define name="page">
        <pm:view id="clientData">
            <pm:header title="Rozliczenia">             
                <f:facet name="left"><p:button value="Wróć" icon="back" onclick="PrimeFaces.back()"/></f:facet>
            </pm:header>
            <pm:content>
                <p:dataTable id="salesTable" var="rcv" value="#{paymentBean.receivablesByClient}">
                    <f:attribute name="columnToggle" value="true" />
                       <f:attribute name="btnText" value="Wyświetlane kolumny" /> 

                    
                    <p:column headerText="ID">  
                           <f:attribute name="priority" value="1" />
                   #{rcv.receivableId}
                    </p:column>  

                    <p:column headerText="Kwota">  
                           <f:attribute name="priority" value="1" />
                        #{rcv.amount}
                    </p:column>  

                    <p:column headerText="Naliczona">  
                            <f:attribute name="priority" value="2" />
                     #{tarrifsParks.getCreationDate(rcv)} 
                    </p:column>  

                    <p:column headerText="Płatna do">  
                    #{tarrifsParks.getPayDeadline(rcv)}
                    </p:column>  

                    <p:column headerText="Przepustka">  
                            <f:attribute name="priority" value="2" />
                   #{rcv.parkingPassId.parkingPassId}
                    </p:column>    
                    
                   <p:column headerText="#{bundle['payments.paymentDate']}"> 
                          <f:attribute name="priority" value="2" />
                            #{paymentBean.getPaymentByReceivable(rcv) eq null ? bundle['payments.unPayed']: paymentBean.getPaymentDateForUser(rcv)}
                        </p:column>

                        <p:column headerText="#{bundle['payments.paymentType']}">
                               <f:attribute name="priority" value="1" />
                            #{paymentBean.getPaymentByReceivable(rcv) eq null ? bundle['payments.unPayed']: paymentBean.getPaymentTypeForUSer(rcv)}
                        </p:column>
                </p:dataTable>                 




            </pm:content>
        </pm:view>

    </ui:define>
</ui:composition>